import request from '@/utils/request'

// 手动同步视频设备
export function syncVideoDevices() {
  return request({
    url: '/iot/web/iot_device/sync',
    method: 'get'
  })
}

// 查询视频设备列表
export function getVideoDeviceList(params) {
  return request({
    url: '/iot/web/iot_device/list',
    method: 'get',
    params
  })
}

// 获取设备详情
export function getVideoDeviceDetail(deviceId) {
  return request({
    url: `/iot/web/iot_device/${deviceId}`,
    method: 'get'
  })
}

// 获取站点下拉列表
export function getSiteList() {
  return request({
    url: '/iot/web/iot_device/siteList',
    method: 'get'
  })
}

// 关联站点
export function bindDeviceToSite(data) {
  return request({
    url: '/iot/web/iot_device/bindSite',
    method: 'post',
    data
  })
}

// 获取设备下拉列表
export function getDeviceDropdownList(stationId) {
  return request({
    url: '/iot/web/iot_device/deviceList',
    method: 'get',
    params: { stationId }
  })
}

// 获取清晰度下拉列表
export function getQualityList() {
  return request({
    url: '/iot/web/iot_device/qualityList',
    method: 'get'
  })
}

// 获取码流信息列表
export function getStreamList(params) {
  return request({
    url: '/iot/web/iot_device/streams/list',
    method: 'get',
    params
  })
}

// 获取历史视频记录
export function getHistoryVideoList(params) {
  return request({
    url: '/iot/web/iot_device/history/list',
    method: 'get',
    params
  })
}

// 解除关联
export function unbindDevice(deviceId) {
  return request({
    url: `/iot/web/iot_device/unbindSite`,
    method: 'get',
    params:{deviceId}
  })
}

// 获取单个站点信息
export function getSiteInfo(siteId) {
  return request({
    url: `/iot/web/iot_device/getSiteInfo`,
    method: 'get',
    params:{siteId}
  })
}